package cn.school.service;

import cn.school.dao.SubjectDao;
import cn.school.entity.Subject;
import cn.school.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

public class SubjectService {
    public int add(Subject s){
        SqlSession sqlSession = MyBatisUtil.get();
        try{
            SubjectDao sd = sqlSession.getMapper(SubjectDao.class);
            return sd.add(s);
        }finally {
           MyBatisUtil.close(sqlSession);
        }
    }
}
